﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Brain.Logic.AI;
using Brain;

namespace Demos
{
    public class IdleAction : IAIAction
    {
        public void Update(IArtificialIntelligence AI)
        {
        }

        public void Look(IArtificialIntelligence AI, IArtificialIntelligence anotherAI)
        {
            AIData3D data = AI.Data as AIData3D;

            if (data.ViewFrustum.Contains(anotherAI.Position) == Microsoft.Xna.Framework.ContainmentType.Contains)
            {
                // We need to check if this AI is on the same team.
                // On this case, we are just differentiating the Red/Blue team
                // by it's AI Info.
                // But in real game scenarios, it's most interesting to have some value
                // called Team, with an ID

                if (anotherAI.Info != data.Info)
                {
                    // ENEMY FOUND
                    AI.SwitchStatus(AIStatus.Fighting);
                }
            }
        }
    }
}
